package com.jh.user.business;

import cn.jh.common.exception.ServiceException;
import com.google.common.collect.Multimap;
import com.jh.user.pojo.*;
import com.jh.user.service.BrandRateRequest;

import java.math.BigDecimal;
import java.util.List;

public interface BrandManageBusiness {


	public Brand  findBrandById(long  id);

	public  List<Brand>   findAllBrand();

	public Brand  mergeBrand(Brand brand) throws ServiceException;

	public Brand  mergeBrandNumber(String number);


	public BrandCoin  findBrandCoin(long brandid);

	public BrandCoin addBrandCoin(BrandCoin Brandcoin);

	public List<Brand>  findBrandByName(String name);


	public Brand  findBrandByManageid(long  manageid);

	public  List<Brand>  findBrandByManageids(Long[]  manageids);

	public BrandRate mergeBrandRate(BrandRate brandRate);

	public BrandRate findRateByBrandAndChannel(long brandid, long channelid, String userGrade, Short payType,String channelMerType);

	public BrandRate findRateByBrandAndChannel(long brandid, long channelid, String userGrade, Short payType);

	List<BrandRate> findRateByBrandAndChannel(Multimap<Long, Long> brandIdsAndChannelIds);

	public List<BrandRate> findRateByBrand(long brandid);


	public List<Resource> findResourceByBrand(long brandid);


	public void  delResourceByBrand(long brandid,  long resourceid)throws Exception;

	public BrandResource   saveBrandResource(BrandResource  brandResource);


	public List<Resource>  findAllResource();


	public Resource  mergeResource(Resource resource);

	public void delResource(long resourceid);

	public void updateBrandMange(long brandid, String branddescription);

	public Brand findByUserIdAndBrandId(long userId, long brandid);

	UserBrandJhKey findBrandJhKeyById(long brandid, String keyPlan);

	UserBrandJhKey findByBrandIdAndKeyPlan(long brandid,String keyPlan);

	List<UserBrandJhKey> findByBrandIdAndKeyList(long brandid);

	/**
	 * 更新公共费率配置信息
	 *
	 * @param rateRequest 配置更新请求信息
	 * @return 返回费率配置信息
	 */
	BrandRate updateBrandRate(BrandRateRequest rateRequest, BigDecimal minrate) throws ServiceException;

	/**
	 * 查询公共费率信息
	 *
	 * @param rateRequest 查询参数
	 * @return 返回公共费率信息
	 */
	List<BrandRate> findBrandRate(BrandRateRequest rateRequest);

	Brand updateBrand(Brand brand) throws ServiceException;
}
